<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateVersionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('versions', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string("version")->comment("版本号");
            $table->boolean("is_whole")->default(0)->comment("是否整包更新，1整包更新，0分包更新");
            $table->boolean("is_force")->default(0)->comment("是否强制更新，1强制更新，0非强制更新");
            $table->string('hash')->default('')->comment("文件md5值");
            $table->string('part_hash')->default('')->comment("分包文件md5值");
            $table->integer('download_num')->default(0)->comment('下载次数');
            $table->string('description', 1024)->default('')->comment("版本描述");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('versions');
    }
}
